import React from 'react';
import { BrowserRouter, Switch, Route, HashRouter } from 'react-router-dom';
import App from './App';
import Admin from './Admin';
import Login from './pages/login';
import SwiperList from './pages/swiper/swiperList';
import ConnectList from './pages/connect/connectList';
import TerraceList from './pages/terrace/terraceList';
import FreeList from './pages/free/freeList';
import JihuoList from './pages/jihuo/jihuoList';
import SendGoods from './pages/sendGoods/sendGoodsList';
import SendCodes from './pages/sendCodes/sendCodesList';
import Config from './pages/config/index';
import Kefu from './pages/kefu/index';

class IRouter extends React.Component {
    constructor(props) {
        super(props);
        this.state = {  

        };
    }


    render() {
        return (
            <HashRouter>
                <App>
                    <Route path="/login">
                        <Login/>
                    </Route>
                    <Route path="/admin" render={()=>
                        <Admin>
                            <Switch>  
                                <Route path="/admin/swiper/swiperList">
                                    <SwiperList />
                                </Route>
                                <Route path="/admin/terrace/TerraceList">
                                    <TerraceList />
                                </Route>
                                <Route path="/admin/connect/connectList">
                                    <ConnectList />
                                </Route>
                                <Route path="/admin/free/freeList">
                                    <FreeList />
                                </Route>
                                <Route path="/admin/jihuo/jihuoList">
                                    <JihuoList />
                                </Route>
                                <Route path="/admin/sendGoods/sendGoodsList">
                                    <SendGoods />
                                </Route>
                                <Route path="/admin/sendCodes/sendCodesList">
                                    <SendCodes />
                                </Route>
                                <Route path="/admin/home/Config">   
                                    <Config />
                                </Route>
                                <Route path="/admin/kefu/Config">   
                                    <Kefu />
                                </Route>
                            </Switch>
                        </Admin>
                    }>
                    </Route>
                </App>
            </HashRouter>
        );
    }
}

export default IRouter;